<!--

    Copyright (c) 2009, 2018 Oracle and/or its affiliates. All rights reserved.

    This program and the accompanying materials are made available under the
    terms of the Eclipse Public License v. 2.0, which is available at
    http://www.eclipse.org/legal/epl-2.0.

    This Source Code may also be made available under the following Secondary
    Licenses when the conditions for such availability set forth in the
    Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
    version 2 with the GNU Classpath Exception, which is available at
    https://www.gnu.org/software/classpath/license.html.

    SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0

-->

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">
    <h:head>
        <title>Flash test</title>
    </h:head>
    <h:body bgcolor="white">
        <h:form prependId="false" id="form1">

            #{sessionScopedBean.message}

            <c:set target="#{flash}" property="foo" value="fooValue" />

            <h:panelGrid columns="2" border="1" width="600">

                Put <code>fooValue</code> in the flash under key <code>foo</code>
                using <code>c:set</code>.  Note that things stored in the flash
                during <b>this</b> request are only retrievable on the <b>next</b>
                request.  If you want to store something on this request and see it
                on this one as well, use either
                <code>\#{flash.now.foo}</code> or
                <code>\#{requestScope.foo}</code>.  The former is simply
                an alias for the latter.

                <f:verbatim>
                    c:set target="\#{flash}" property="foo" value="fooValue" 
                </f:verbatim>

                <f:verbatim>
                    Value of <code>\#{flash.foo}</code>, should be <code>null</code>.
                </f:verbatim>

                <h:outputText id="fooValueId" value="#{flash.foo}" />

                <h:commandButton value="reload" id="reload" />

                <h:commandButton value="next" id="next" action="next" />

            </h:panelGrid>

            <p>Type "addMessage", without the quotes, to cause a FacesMessage to
                be added <h:inputText id="inputText"
                                      value="#{bean.stringVal}" /></p>

            <p><h:messages id="messages"/></p>

            <ui:debug />

        </h:form>

    </h:body>
</html>  
